﻿using Logistics.Statist;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace Logistics.Web.Controllers
{
    public class StatisticsController : Controller
    {
        private readonly IStatitsAppService _istatitsAppService;

        public StatisticsController(IStatitsAppService istatitsAppService)
        {
            _istatitsAppService = istatitsAppService;
        }
        ///// <summary>
        ///// 删除
        ///// </summary>
        ///// <param name="id"></param>
        ///// <returns></returns>
        //public Task DeleteAsyncc(int id)
        //{
        //    var i = _istatitsAppService.DeleteAsync(id);
        //    return i;
        //}
        ///// <summary>
        ///// 查看视图
        ///// </summary>
        ///// <returns></returns>
        //public ActionResult GetStatitsIndex(int id)
        //{
        //    ViewBag.Id = id;
        //    return View();
        //}
        ///// <summary>
        ///// 反填视图
        ///// </summary>
        ///// <param name="id"></param>
        ///// <returns></returns>
        //public ActionResult PutStatitsIndex(int id)
        //{
        //    ViewBag.Id = id;
        //    return View();
        //}
        //public IActionResult Updates(StatistDto Statist)
        //{
        //    var statistdto = _istatitsAppService.UpdateAsync(Statist);
        //    return Ok(statistdto);
        //}

        ///// <summary>
        ///// 查看详情/反填
        ///// </summary>
        ///// <param name="id"></param>
        ///// <returns></returns>
        //public Task<StatistDto> GetAsyncc(int id)
        //{
        //    var statistdto = _istatitsAppService.GetAsync(id);
        //    return statistdto;
        //}
        ///// <summary>
        ///// 添加视图
        ///// </summary>
        ///// <returns></returns>
        //public ActionResult PostStatitsIndex()
        //{
        //    return View();
        //}
        ///// <summary>
        ///// 添加
        ///// </summary>
        ///// <param name="Procurement"></param>
        ///// <returns></returns>
        //public IActionResult Add(StatistDto statistdto)
        //{
        //    var i = _istatitsAppService.CreateAsync(statistdto).Result;
        //    return Ok(i);
        //}
        // GET: ApproveController
        public ActionResult StatitsIndex()
        {
            //GetListAsync(pageIndex);
            return View();
        }

        //GET: ApproveController/Details/5
        public JsonResult ShowStatitsAsynccc(GetStatitsListDto getStatitsListDto)
        {
            var Statits = _istatitsAppService.GetListAsync(getStatitsListDto).Result;
            return Json(new { data = Statits.Items, count = Statits.TotalCount, code = "0", msg = "" });
        }
    }
}
